package com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.repo

import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.Constants
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.StuStudyAnalysisInfo
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.StudyAnalysisInfo
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.remote.BaseData
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.remote.StudyAnalysisService
import io.reactivex.Single

/**
 * Created by Dadong on 2021/1/26
 * Describe:
 */
class StudyAnalysisRepo constructor(private val remote: StudyAnalysisService) {

    /*
   * 是否开启班级学情分析 接口
   * */
    fun isOpenClassLearningAnalysisApp(): Single<BaseData<Boolean>> {
        val params = Constants.createParamas()
        return remote.isOpenClassLearningAnalysisApp(params)
    }

    /*
   * 获取班级学情分析报告（班级学情总览 + 班级学生试卷作答荣誉榜 + 班级各题型得分总览 + 班级试卷作答表现） 接口
   * */
    fun getClassLearningAnalysis(dateField: Int): Single<BaseData<StudyAnalysisInfo>> {
        val params = Constants.createParamas()
        params["DateField"] = dateField
        return remote.getClassLearningAnalysis(params)
    }

    /*
 * 获取学生学情分析报告（
 * */
    fun getStuLearnAnalysisApp(dateField: Int, stuId: String): Single<BaseData<StuStudyAnalysisInfo>> {
        val params = Constants.createParamas()
        params["DateField"] = dateField
        params["StuID"] = stuId
        return remote.getStuLearnAnalysisApp(params)
    }


}